package WrittenTest;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

class Read1 {
    StringTokenizer st = new StringTokenizer("");
    BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));

    String next() throws IOException {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(bf.readLine());
        }
        return st.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

}

public class test11 {
    // 读入n，x，给出n个数a[1],a[2],……,a[n]，求最小的区间[l,r]，使a[l]+a[l+1]+……+a[r]≥x
    // 若存在相同长度区间，输出l最小的那个
    // 算法原理: 滑动窗口
    public static void main(String[] args) throws IOException {
        Read1 in = new Read1();
        int n = in.nextInt(), x = in.nextInt();
        int[] nums = new int[n + 1];
        // 读入数据
        for (int i = 1; i <= n; i++) {
            nums[i] = in.nextInt();
        }
        // 定义双指针
        int left = 1, right = 1, sum = 0;
        int retLeft = -1, retRight = -1, retLen = Integer.MAX_VALUE;
        // 进窗口
        while (right <= n) {
            // sum统计和
            sum += nums[right];
            while (sum >= x) {
                // 此区间比上一个区间小时，更新retLeft，retRight，retLen
                if (right - left + 1 < retLen) {
                    retLeft = left;
                    retRight = right;
                    retLen = right - left + 1;
                }
                sum -= nums[left++];
            }
            // 出窗口
            right++;
        }
        System.out.println(retLeft + " " + retRight);
    }
}
